Skip to content

Conversation

@21M4TW
Copy link
Contributor

@21M4TW 21M4TW commented Apr 15, 2025

-Fixing offers when offer_paths are present and offer_issuer_id is no longer needed.
-There is a missing piece however in plugins/offers_invreq_hook.c, which causes an error in plugins/fetchinvoice.c when trying to fetch an invoice for an offer without offer_issuer _id. Comments were added to describe the remaining issue.

Important

25.05 FREEZE MAY 12TH: Non-bugfix PRs not ready by this date will wait for 25.08.

RC1 is scheduled on May 23rd, RC2 on May 26th, ...

The final release is on MAY 29TH.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • [ x] The changelog has been updated in the relevant commit(s) according to the guidelines.
  • [ x] Tests have been added or modified to reflect the changes.
  • [ x] Documentation has been reviewed and updated as needed.
  • [ x] Related issues have been listed and linked, including any that this PR closes.

21M4TW and others added 2 commits April 15, 2025 08:49
longer needed.
-There is a missing piece however in plugins/offers_invreq_hook.c, which
causes an error in plugins/fetchinvoice.c when trying to fetch an
invoice for an offer without offer_issuer _id. Comments were added to
describe the remaining issue.
@21M4TW
Copy link
Contributor Author

21M4TW commented Apr 15, 2025

As requested by @vincenzopalazzo

@21M4TW
Copy link
Contributor Author

21M4TW commented Aug 25, 2025

I thought this issue would be addressed in #8326 , but it was closed. As of 25.09rc2, it is still unresolved. For example:

lightning-cli fetchinvoice lno1qgsyxjtl6luzd9t3pr62xr7eemp6awnejusgf6gw45q75vcfqqqqqqq2qahx2am5v4ehgy8wq0juncvsaya0ta6hu5e66yk29k5a4mue7vm60tcryrnsl6hf57ysqqajynayv4g8hac5vswxfggp3nxqtw7d5cxn4g2jztjh0h7curaeagpqyq4fv28ej952pvyu3hw8r0v3j833lpcswhxcs4yk3kah94ru8yfpqqeczwddqgnkqpl2jx86wgy8vk3sdssqc7hcznqzsn0v5l8dzweksc7gf5pnjdtjaazdgntcen5mp06c5mlccqkp59jlucd5l3kzp9a7udx48rausjgzma3wp0uw4jq5jkt36jgmxcqryjjxrp83cgmlt994e4re0au5czelyfnm3l63u4fhd2ns2wjmwz9d03c9dhgt2d6fgkq2lru89wvh9n4m5 11

{ "code": 1004, "message": "Incorrect invoice_node_id field in \"0010fc84667539e41bd6564fbbdb87d3375e022043497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea3309000000000a076e65777465737410ee03e5c9e190e93af5f757e533ad12ca2da9daef99f337a7af0320e70feae9a7890003b224fa465507bf714641c64a1018ccc05bbcda60d3aa15212e577dfd8e0fb9ea020202a9628f99168a0b09c8ddc71bd9191e31f871075cd8854968dbb72d47c3912100338139ad02276007ea918fa7208765a306c200c7af814c0284deca7ced13b36863c84d03393572ef44d44d78cce9b0bf58a6ff8c02c1a165fe61b4fc6c2097bee34d538fbc84902df62e0bf8eac81495971d491b3600324a46184f1c237f594b5cd4797f794c0b3f2267b8ff51e55376aa7053a5b708ad7c7056dd0b537494580af8f872b9972cebba502043497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea33090000000052010b54005821037d942d1f385d68bf600ed3ce14d1e0b84f99eaa594196e60dedc4a6eae3064fea0fd00fd03e5c9e190e93af5f757e533ad12ca2da9daef99f337a7af0320e70feae9a789000304e360cbffb0e81e6489baad6b24762b28c1f98bec4fcd7771db32906baababd02038e48152e6f2388282153b34bd136a812b71648f3c15c894d1c50afc45ac154cd0042f6ace0f6e49219b7dbca6f38e0f53a2f70b06403692dfa04d6ba0734fb2084b1c4cf1d7d42567c59715cdbef764fe63440ddb41e7fe67e34be6bdccac4a59f7d596002d7759d4d3b3d3a2fe68bffbbcad4b68456f60fe8c0877c92990e7ed402939cc000323fd7cf52b11be81729bcf3a0dcf3b9aae68351b3f1bd40c29db363573aebefa38d44988c0929ae3c1ad3052b48d38327ab6ba21c000000010000000a0010000000000000000000000000002380000000a40468ac799ea820d6e635a2de2108f755ac860e2a6e80ab9798dc73ab55e6b6c54eda1025e6dadfaa010bae03020000f0409558b15edc9a8b402eb1a54512caae3b82d31f61c04e849a5491d075d5d0ebf7b3f0ae39e8541496ec374a38ec8ea947de2a74ba4b22efb34a859e55506726cc\"" }

blinded_node_id when offer_issuer_id is not present and offers_path is
present.
@21M4TW 21M4TW force-pushed the bolt12_offer_issuer_id branch from 86ec127 to 5c53729 Compare August 25, 2025 19:19
@21M4TW
Copy link
Contributor Author

21M4TW commented Aug 25, 2025

@vincenzopalazzo I think I fixed the remaining issue with invoice_node_id when there is no offer_issuer_id . Note that the code that handles the signature will also need to be updated so the invoice gets signed by the final blinded_node_id instead of the node creating the invoice, as mentioned (but not described?) in the specifications.

@vincenzopalazzo vincenzopalazzo self-requested a review August 26, 2025 13:36
@rustyrussell
Copy link
Contributor

rustyrussell commented Sep 16, 2025

This invoice is invalid: let's break it down by type, length, value (hex)

  • 00 10 fc84667539e41bd6564fbbdb87d3375e
  • 02 20 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000
  • 0a 07 6e657774657374
  • 10 ee 03e5c9e190e93af5f757e533ad12ca2da9daef99f337a7af0320e70feae9a7890003b224fa465507bf714641c64a1018ccc05bbcda60d3aa15212e577dfd8e0fb9ea020202a9628f99168a0b09c8ddc71bd9191e31f871075cd8854968dbb72d47c3912100338139ad02276007ea918fa7208765a306c200c7af814c0284deca7ced13b36863c84d03393572ef44d44d78cce9b0bf58a6ff8c02c1a165fe61b4fc6c2097bee34d538fbc84902df62e0bf8eac81495971d491b3600324a46184f1c237f594b5cd4797f794c0b3f2267b8ff51e55376aa7053a5b708ad7c7056dd0b537494580af8f872b9972cebba
  • 50 20 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000
  • 52 01 0b
  • 54 00
  • 58 21 037d942d1f385d68bf600ed3ce14d1e0b84f99eaa594196e60dedc4a6eae3064fe
  • a0 fd00fd 03e5c9e190e93af5f757e533ad12ca2da9daef99f337a7af0320e70feae9a789000304e360cbffb0e81e6489baad6b24762b28c1f98bec4fcd7771db32906baababd02038e48152e6f2388282153b34bd136a812b71648f3c15c894d1c50afc45ac154cd0042f6ace0f6e49219b7dbca6f38e0f53a2f70b06403692dfa04d6ba0734fb2084b1c4cf1d7d42567c59715cdbef764fe63440ddb41e7fe67e34be6bdccac4a59f7d596002d7759d4d3b3d3a2fe68bffbbcad4b68456f60fe8c0877c92990e7ed402939cc000323fd7cf52b11be81729bcf3a0dcf3b9aae68351b3f1bd40c29db363573aebefa38d44988c0929ae3c1ad3052b48d38327ab6b
  • a2 1c 000000010000000a0010000000000000000000000000002380000000
  • a4 04 68ac799e
  • a8 20 d6e635a2de2108f755ac860e2a6e80ab9798dc73ab55e6b6c54eda1025e6dadf
  • aa 01 0b
  • ae 03 020000
  • f0 40 9558b15edc9a8b402eb1a54512caae3b82d31f61c04e849a5491d075d5d0ebf7b3f0ae39e8541496ec374a38ec8ea947de2a74ba4b22efb34a859e55506726cc

This has no "b0" field (i.e. type: 176 (invoice_node_id)).

To quote bolt12:

A writer of an invoice:
...
  - if `offer_issuer_id` is present:
    - MUST set `invoice_node_id` to the `offer_issuer_id`
  - otherwise, if `offer_paths` is present:
    - MUST set `invoice_node_id` to the final `blinded_node_id` on the path it received the invoice request

And:

A reader of an invoice:
  - MUST reject the invoice if `invoice_amount` is not present.
  - MUST reject the invoice if `invoice_created_at` is not present.
  - MUST reject the invoice if `invoice_payment_hash` is not present.
  - MUST reject the invoice if `invoice_node_id` is not present.

So, who is producing this invalid invoice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants